#pragma once
#include "Vector3f.h"
#include "Physics.h"
#include <GLTools.h>
#include <GLGeometryTransform.h>
#include <GLMatrixStack.h>
#include <GLFrame.h>
#include <iostream>
#include <math3d.h>

class Camera
{
private:
	GLFrame	cam;
	float rot;
	GLMatrixStack *pMVM;
	Vector3f position,target;
	int camMode;
public:
	Camera(GLMatrixStack *pMVM);
	void changeMode(int mode);
	int getMode();

	void setForwardVector(Vector3f v);			//Custom vector class compatability
	void setForwardVector(float* v);			//GLTools compatability

	M3DMatrix44f *camMx;
	void pushMatrix(bool sky = false);
	void popcam();
	void update(float*ppos,float*pang);						//GLTools compatability
	void update(Vector3f pos = Vector3f(10.0f,1.0f,20.0f),	//Custom vector class compatability
				Vector3f tgt = Vector3f(-2.0f,0.0f,0.0f)); 
	void spin();
	M3DMatrix44f *getMx(bool sky=false);
	~Camera();




	inline void moveIn(){cam.MoveForward(1);};
	inline void moveOut(){cam.MoveForward(-1);};
	inline void strafeLeft(){cam.MoveRight(1);};
	inline void strafeRight(){cam.MoveRight(-1);};
	void moveForward();
	void moveBackward();
	inline void rotateAntiClockWise(float irotationrate){if(camMode==99){cam.RotateWorld(irotationrate,0,1,0);}};
	inline void rotateUp(float irotationrate){if(camMode==99){cam.RotateLocalX(-irotationrate);}};
	inline void resetForwardVector(){cam.SetForwardVector(0,0,-1);};
	inline void resetUpVector(){cam.SetUpVector(0,1,0);}; 

	inline void getForwardVector(M3DVector3f itemp){cam.GetForwardVector(itemp);};

};

